<?php
require("include/top.php");
$tpl->display("header.tpl");


if(!empty($_POST['log'])){
require(FORM_PATH."login.form.php");
	if(sizeof($_SESSION['vendor']['id'])>0) {
		$tpl->display("menu.tpl");
		$tpl->display("accueil.tpl");
	}
	elseif (sizeof($_SESSION['sharing']['id'])>0) {
		$tpl->display("menu.tpl");
		$tpl->display("accueil.tpl");
	}
	else {$tpl->display("login.tpl");
	}
}
elseif((!empty($_SESSION['vendor']['id']))||(!empty($_SESSION['sharing']['id']))) {
$tpl->display("menu.tpl");
$tpl->display("accueil.tpl");
}
else {
$tpl->display("login.tpl");
}
$tpl->display("footer.tpl");
require("include/bottom.php");	

?>